<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<script type="text/javascript">
		//跳转到某一页
		function goPage(pageCount){
			var pageNum = $("#goPageId").val();
			if(pageNum!=null && pageNum!=""&&!isNaN(pageNum)){
				if(parseInt(pageNum) > 0 && parseInt(pageNum)<=pageCount){
					page(pageNum);
				}else{
					bootbox.alert("请输入1-"+pageCount+"之间的数字");
				}
			}	
		}
	
		function page(page){
			$("#pageNumber").val(page);
			$("#listForm").submit();
		}
	</script>
</head>
<body>
	<div class="row" style="text-align: center;">
				<ul class="pagination pagination-sm">
				  <li class="disabled">
				  	<a href="javascript:void(0);">
				  		总共${pageModel.recordCount}条记录，每页显示${pageModel.pageSize }条,当前第${pageModel.pageIndex}页  | 共${pageModel.pageCount}页
				  	</a>
				  </li>
				  <li <c:if test="${pageModel.pageIndex==1}">class='disabled'</c:if> >
				  		<c:choose>
				  			<c:when test="${pageModel.pageIndex==1}">
				  				<a href="javascript:void(0)">&laquo;首页</a>
				  			</c:when>
				  			<c:otherwise>
				  				<a href="javascript:page(1)">&laquo;首页</a>
				  			</c:otherwise>
				  		</c:choose>
				  </li>
				  <li <c:if test="${pageModel.pageIndex==1}">class='disabled'</c:if> >
				  		<c:choose>
				  			<c:when test="${pageModel.pageIndex==1}">
				  				<a href="javascript:void(0)">上一页</a>
				  			</c:when>
				  			<c:otherwise>
				  				<a href="javascript:page(${pageModel.pageIndex-1})">上一页</a>
				  			</c:otherwise>
				  		</c:choose>
				  </li>
				  <li <c:if test="${pageModel.pageIndex==pageModel.pageCount || pageModel.pageCount==0}">class='disabled'</c:if> >
				  		<c:choose>
				  			<c:when test="${pageModel.pageIndex==pageModel.pageCount || pageModel.pageCount==0}">
				  				<a href="javascript:void(0)">下一页</a>
				  			</c:when>
				  			<c:otherwise>
				  				<a href="javascript:page(${pageModel.pageIndex+1})">下一页</a>
				  			</c:otherwise>
				  		</c:choose>
				  </li>
				  <li <c:if test="${pageModel.pageIndex==pageModel.pageCount || pageModel.pageCount==0}">class='disabled'</c:if> >
				  		<c:choose>
				  			<c:when test="${pageModel.pageIndex==pageModel.pageCount || pageModel.pageCount==0}">
				  				<a href="javascript:void(0)">尾页&raquo;</a>
				  			</c:when>
				  			<c:otherwise>
				  				<a href="javascript:page(${pageModel.pageCount})">尾页&raquo;</a>
				  			</c:otherwise>
				  		</c:choose>
				  </li>
				</ul>
				
				<ul class="pagination pagination-sm" >
					<li class="disabled">
						<a href="javascript:void(0);" style="padding: 1px;padding-left: 5px;">
							跳转到<input type="text" id="goPageId" value="" style="width: 35px;height: 25px;" 
							onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"  
                                    onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"/>
								<input type="hidden" id="pageNumber" name="pageIndex" value="${pageModel.pageIndex}"  >
						</a>
					</li>
					<li><a href="javascript:goPage(${pageModel.pageCount})">GO</a></li>
				</ul> 
			</div>
</body>
</html>